<template>
	<view class="container">
		
		<view class="card">
		<text>{{info.title}}</text>
		<br/>
		<text>{{info.content}}</text>
		</view>
		<!-- <button type="primary" @click="clickDetail">详情</button> -->
	</view>
</template>

<script>

	import {websock} from '../../net/websock'

	export default {
		data() {
			return {
				info: {}
			}
		},
		async onLoad(params) {
			console.log('on load')

			try {
				this.info = await websock.getNotificationInfo({id: params.id})
			} catch (err) {
				uni.showToast({title: err.message || 'error'})
			}
		},
		methods: {
			// 点击详情
			async clickDetail() {
				if (this.info.typ == 15) { // 公文信息
					uni.navigateTo({url: '/pages/notification/gongwenInfo?id=' + this.info.relevenceId})
				}
			}
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
		background-image: url(/static/login/bg.png);
		background-repeat: no-repeat;
		background-size: 100%;
	}
	.card {
		border: 1px solid #e6e6e6;
		border-radius: 10px;
		background-color: white;
		font-size: 14px;
		padding: 10px 20px 10px 20px;
	}
	
	.card-title {
		border-bottom: 1px #DCDCDC solid;
		padding-bottom: 5px;
		border-bottom: 1px #DCDCDC solid;
	}
	
	.card-body {
		padding-top: 5px;
		padding-bottom: 10px;
	}
	
	.card-footer {
		padding-top: 15px;
		text-align: right;
	}
</style>
